def _weekday_test(date, kwargs):
    """
    Computes weekly indicators.
    """
    if 'weekday' in kwargs:
        weekday = kwargs['weekday']
        if date.weekday() == weekday:
            return 1
        else:
            return 0
    else:
        return date.weekday()
