Check for Period Error.

    This method checks if the developer is trying to enter a period that is
    larger than the data set being entered. If that is the case an exception is
    raised with a custom message that informs the developer that their period
    is greater than the data set.

def check_for_period_error(data, period):
    """
    Check for Period Error.

    This method checks if the developer is trying to enter a period that is
    larger than the data set being entered. If that is the case an exception is
    raised with a custom message that informs the developer that their period
    is greater than the data set.
    """
    period = int(period)
    data_len = len(data)
    if data_len < period:
        raise Exception("Error: data_len < period")