Build a validator that only checks the type of a value.

def _build_type_validator(value_type):
    """Build a validator that only checks the type of a value."""

    def type_validator(data):
        """Validate instances of a particular type."""
        if isinstance(data, value_type):
            return data

        raise NotValid('%r is not of type %r' % (data, value_type))

    return type_validator