'Periods can be: days, weeks, months, years.
Days referenced from midnight on the current computer\'s clock.
Weeks referenced from Monday morning @ 00:00:00am.
Months and years follow from the above.'

@classmethod
def get_period_start_datetime(cls, log_time, summary_freq):

    summary_freq_qty = summary_freq[0]
    summary_freq_period = summary_freq[1].lower()
    base_time = log_time.replace(microsecond=0, second=0, minute=0, hour=0)
    if (summary_freq_period in ['day', 'days']):
        assert (summary_freq_qty == 1), 'Days    only    supports    1'
        return base_time
    elif (summary_freq_period in ['week', 'weeks']):
        assert (summary_freq_qty == 1), 'Weeks    only    supports    1'
        raise NotImplementedError('Still    working    to    implement    weeks.')
    elif (summary_freq_period in ['month', 'months']):
        assert (summary_freq_qty in [1, 2, 3, 4, 6]), 'Months    only    supports    [1,2,3,4,6]'
        return base_time.replace(day=1, month=((log_time.month / summary_freq_qty) * summary_freq_qty))
    elif (summary_freq_period in ['year', 'years']):
        assert (summary_freq_qty in [1, 2, 3, 4, 6]), 'Years    only    supports    1'
        return base_time.replace(day=1, month=1)
    else:
        raise NotImplementedError(('Unrecognized    summary    frequency    period:    %s' % summary_freq_period))
