def check_membership(container):
    """

    :param container:
    :return:

        >>> checker = check_membership((1, 2, 3))
        >>> checker(1)
        1
        >>> checker(0)
        Traceback (most recent call last):
        ...
        ValueError: 0 not in (1, 2, 3)

    """

    def _inner(value):
        if value not in container:
            raise ValueError('{!r} not in {}'.format(value, container))
        return value
    return _inner
dataset/ETHPy150Open LabPy/lantz/lantz/processors.py/check_membership/original