'Validate an RDFValue instance.
Args:
value: An RDFValue instance or something which may be used to instantiate
the correct instance.
Raises:
TypeValueError: If the value is not a valid RDFValue instance or the
required type.
Returns:
A Valid RDFValue instance.'

def Validate(self, value):

    if (value is None):
        return
    if (not isinstance(value, self.rdfclass)):
        try:
            return self.rdfclass(value)
        except rdfvalue.InitializeError:
            raise TypeValueError(('Value    for    arg    %s    should    be    an    %s' % (self.name, self.rdfclass.__class__.__name__)))
    return value
