@classmethod
    def ensure_value_type(cls, value_type, parameter=None):
        typename = '.'.join((cls.__module__, cls.__name__))
        if isinstance(value_type, type):
            subname = '.'.join((value_type.__module__, value_type.__name__))
            if issubclass(value_type, cls):
                try:
                    return value_type()
                except TypeError as e:
                    raise TypeError(
                        '{0} must implement the constructor which takes '
                        'no arguments; {1}'.format(subname, e)
                    )
            else:
                if parameter:
                    msg = '{0} must be a subtype of {1}, but {2} was passed'
                else:
                    msg = 'expected a subtype of {1}, but {2} was passed'
                raise TypeError(msg.format(parameter, typename, subname))
        elif isinstance(value_type, Value):
            if isinstance(value_type, cls):
                return value_type
            else:
                if parameter:
                    msg = '{0} must be an instance of {1}, ' \
                          'but {2!r} was passed'
                else:
                    msg = 'expected an instance of {1}, but {2!r} was passed'
                raise TypeError(msg.format(parameter, typename, value_type))
        else:
            if parameter:
                msg = '{0} must be a type, not {1!r}'
            else:
                msg = 'expected a type, not {1!r}'
            raise TypeError(msg.format(parameter, value_type))
Raises a :exc:`TypeError` if the given ``value_type`` is not
dataset/ETHPy150Open dahlia/sider/sider/types.py/Value.ensure_value_type