def METHOD_NAME(beam, beam_collimation, rotation_direction, dose_rate):
    cps = {}
    cps["first"] = beam.ControlPointSequence[0]
    cps["mid"] = beam.ControlPointSequence[1]
    cps["last"] = beam.ControlPointSequence[-1]
    for cp in cps.values():
        cp.BeamLimitingDevicePositionSequence = beam_collimation
        cp.DoseRateSet = dose_rate
    for key in ["first", "mid"]:
        cps[key].BeamLimitingDeviceRotationDirection = rotation_direction
    return cps