def parse_operating_point(operating_point, operating_kinds, class_names):
    """Checks the operating point contents and extracts the three defined
    variables

    """
    if 'kind' not in operating_point:
        raise ValueError('Failed to find the kind of operating point.')
    elif operating_point['kind'] not in operating_kinds:
        raise ValueError(
            'Unexpected operating point kind. Allowed values are: %s.' %
            ', '.join(operating_kinds))
    if 'threshold' not in operating_point:
        raise ValueError('Failed to find the threshold of the operatingpoint.')
    if operating_point['threshold'] > 1 or operating_point['threshold'] < 0:
        raise ValueError('The threshold value should be in the 0 to 1 range.')
    if 'positive_class' not in operating_point:
        raise ValueError(
            'The operating point needs to have a positive_class attribute.')
    else:
        positive_class = operating_point['positive_class']
        if positive_class not in class_names:
            raise ValueError(
                'The positive class must be one of theobjective field classes: %s.'
                 % ', '.join(class_names))
    kind = operating_point['kind']
    threshold = operating_point['threshold']
    return kind, threshold, positive_class
