def METHOD_NAME(robot, path):
    with robot.GetEnv():
        for q in np.linspace(0, path.duration, 100):
            robot.SetActiveDOFValues(path(q))
            if robot.GetEnv().CheckCollision(robot) or robot.CheckSelfCollision():
                print("Path in collision")