nodes: 0, module; 1, function_definition; 2, function_name:_get_point; 3, parameters; 4, block; 5, identifier:self; 6, identifier:profile; 7, identifier:point; 8, expression_statement; 9, expression_statement; 10, try_statement; 11, comment:"""
          Finds the given point in the profile, or adds it in sorted z order.
          """; 12, assignment; 13, block; 14, except_clause; 15, identifier:cur_points_z; 16, list_comprehension; 17, expression_statement; 18, return_statement; 19, identifier:ValueError; 20, block; 21, attribute; 22, for_in_clause; 23, assignment; 24, subscript; 25, expression_statement; 26, expression_statement; 27, expression_statement; 28, expression_statement; 29, expression_statement; 30, return_statement; 31, attribute; 32, identifier:z; 33, identifier:p; 34, attribute; 35, identifier:cur_idx; 36, call; 37, attribute; 38, identifier:cur_idx; 39, assignment; 40, assignment; 41, assignment; 42, assignment; 43, call; 44, identifier:new_point; 45, identifier:p; 46, identifier:location; 47, identifier:profile; 48, identifier:elements; 49, attribute; 50, argument_list; 51, identifier:profile; 52, identifier:elements; 53, identifier:new_idx; 54, call; 55, identifier:new_point; 56, call; 57, attribute; 58, call; 59, attribute; 60, attribute; 61, attribute; 62, argument_list; 63, identifier:cur_points_z; 64, identifier:index; 65, attribute; 66, identifier:bisect_left; 67, argument_list; 68, identifier:Point; 69, argument_list; 70, identifier:new_point; 71, identifier:location; 72, identifier:sPoint; 73, argument_list; 74, identifier:new_point; 75, identifier:time; 76, identifier:profile; 77, identifier:time; 78, attribute; 79, identifier:insert; 80, identifier:new_idx; 81, identifier:new_point; 82, identifier:point; 83, identifier:z; 84, identifier:cur_points_z; 85, attribute; 86, identifier:point; 87, identifier:profile; 88, identifier:elements; 89, identifier:point; 90, identifier:z
code: def _get_point(self, profile, point):
          """
          Finds the given point in the profile, or adds it in sorted z order.
          """
          cur_points_z = [p.location.z for p in profile.elements]
          try:
              cur_idx = cur_points_z.index(point.z)
              return profile.elements[cur_idx]
          except ValueError:
              new_idx = bisect_left(cur_points_z, point.z)
              new_point = Point()
              new_point.location = sPoint(point)
              new_point.time = profile.time
              profile.elements.insert(new_idx, new_point)
              return new_point