import operator


def _get_operator(comp_str):
    """Returns the operator function corresponding to the given comparison.

    Args:
        comp_str: str. One of: '<', '<=', '=', '>=', '>'.

    Returns:
        callable. The binary operator corresponding to the comparison.

    Raises:
        ValueError. The comparison is not supported.
    """
    if comp_str == '<':
        return operator.lt
    elif comp_str == '<=':
        return operator.le
    elif comp_str == '=':
        return operator.eq
    elif comp_str == '>=':
        return operator.ge
    elif comp_str == '>':
        return operator.gt
    else:
        raise ValueError('Unsupported comparison operator: %s' % comp_str)