def validate_window_size(s):
    """Check if s is integer or string 'adaptive'."""

    try:
        return int(s)
    except ValueError:
        if s.lower() == "adaptive":
            return s.lower()
        else:
            raise ValueError(f'String {s} must be integer or string "adaptive".')