<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datetime_to_hamsterday(civil_date_time):
 """Return the hamster day corresponding to a given civil datetime. The hamster day start is taken into account. """


    # work around cyclic imports
    from hamster.lib.configuration import conf

    if civil_date_time.time() < conf.day_start:
        # early morning, between midnight and day_start
        # => the hamster day is the previous civil day
        hamster_date_time = civil_date_time - dt.timedelta(days=1)
    else:
        hamster_date_time = civil_date_time
    # return only the date
    return hamster_date_time.date()