def METHOD_NAME(target_speed, cx, cy, cyaw):
    speed_profile = [target_speed] * len(cx)
    forward = True
    d = []
    is_back = False
    # Set stop point
    for i in range(len(cx) - 1):
        dx = cx[i + 1] - cx[i]
        dy = cy[i + 1] - cy[i]
        d.append(math.hypot(dx, dy))
        iyaw = cyaw[i]
        move_direction = math.atan2(dy, dx)
        is_back = abs(move_direction - iyaw) >= math.pi / 2.0
        if dx == 0.0 and dy == 0.0:
            continue
        if is_back:
            speed_profile[i] = - target_speed
        else:
            speed_profile[i] = target_speed
        if is_back and forward:
            speed_profile[i] = 0.0
            forward = False
            #  plt.plot(cx[i], cy[i], "xb")
            #  print(i_yaw, move_direction, dx, dy)
        elif not is_back and not forward:
            speed_profile[i] = 0.0
            forward = True
            #  plt.plot(cx[i], cy[i], "xb")
            #  print(i_yaw, move_direction, dx, dy)
    speed_profile[0] = 0.0
    if is_back:
        speed_profile[-1] = -stop_speed
    else:
        speed_profile[-1] = stop_speed
    d.append(d[-1])
    return speed_profile, d