def plan_cost(relaxed_plan, unit=False): return sum(operator.cost if not unit else 1 for operator in flatten( relaxed_plan)) if relaxed_plan is not None else None
def plan_length(relaxed_plan): return len(flatten(relaxed_plan)) if relaxed_plan is not None else None
def convex_hull_vertices( hull ): # NOTE - old scipy uses points while the new scipy uses vertices if not hasattr(hull, 'vertices'): return sorted(set(flatten(hull.simplices))) return hull.vertices