@classmethod
    def forTypes(klass, key, classes, description, extraValidator=None):
        fixedClasses = []
        for k in classes:
            if k is None:
                k = type(None)
            if k not in _JSON_TYPES:
                raise TypeError("%s is not JSON-encodeable" % (k,))
            fixedClasses.append(k)
        fixedClasses = tuple(fixedClasses)

        def validate(value):
            if not isinstance(value, fixedClasses):
                raise ValidationError(
                    value, "Field %r requires type to be one of %s" %
                    (key, classes))
            if extraValidator is not None:
                extraValidator(value)

        return klass(key, lambda v: v, description, extraValidator=validate)


    # PEP 8 variant:
%prog prune best.edges
dataset/ETHPy150Open ClusterHQ/eliot/eliot/_validation.py/Field.forTypes--crossover with--dataset/ETHPy150Open tanghaibao/jcvi/assembly/ca.py/prune