<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def floor(start, resolution):
 """Floor a datetime by a resolution. datetime.datetime(2012, 7, 6, 20, 0) """

    if resolution == STEP_10_SEC:
        return datetime(start.year, start.month, start.day, start.hour,
                        start.minute, start.second - (start.second % 10))
    elif resolution == STEP_1_MIN:
        return datetime(start.year, start.month, start.day, start.hour,
                        start.minute)
    elif resolution == STEP_5_MIN:
        return datetime(start.year, start.month, start.day, start.hour,
                        start.minute - (start.minute % 5))
    elif resolution == STEP_1_HOUR:
        return datetime(start.year, start.month, start.day, start.hour)
    elif resolution == STEP_1_DAY:
        return datetime(start.year, start.month, start.day)

    raise ValueError("{resolution} is not a valid resolution. Valid choices "
                     "are {choices}".format(resolution=resolution,
                                            choices=STEP_CHOICES))