def _check_standardization_interval(standardize_by):
    """Check standardization interval is valid."""

    valid_intervals = ['dayofyear', 'month']
    is_valid = standardize_by is None or standardize_by in valid_intervals

    if not is_valid:
        raise ValueError(
            "Unrecognized standardization interval '%r'" % standardize_by)

    return standardize_by