<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def calculate_priority(ratios=None, **kwargs):
    "Calculates a priority score based on a number of attributes."
    if not ratios:
        ratios = PRIORITY_FEATURE_WEIGHTS
    scores = [DEFAULT_PRIORITY_SCORE]
    for key, value in kwargs.items():
        if key not in PRIORITY_FEATURE_WEIGHTS:
            raise KeyError('The following keyword arguments are supported: '
                           '{keys}'.format(keys=PRIORITY_FEATURES))
        if value is True:
            scores.append(PRIORITY_FEATURE_WEIGHTS[key])
    return float(sum(scores)) / len(scores)