def METHOD_NAME(pathobj):
    out = ""
    if hasattr(pathobj, "Group"):  # We have a compound or project.
        out += "(Group: " + pathobj.Label + ")\n"
        for p in pathobj.Group:
            out += METHOD_NAME(p)
        return out
    else:  # parsing simple path
        if not hasattr(
            pathobj, "Path"
        ):  # groups might contain non-path things like stock.
            return out
        out += "(Path: " + pathobj.Label + ")\n"
        for c in PathUtils.getPathWithPlacement(pathobj).Commands:
            out += str(c) + "\n"
        return out