<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def valueFromDataset(cls, datatype, value, metadata=None, tmap=None):
 """ Return the value contained by dataset argument, after casting to correct type and performing type-specific validation """

        if tmap is None:
            tmap = typemap
        obj = cls.fromDataset(datatype, value, metadata=metadata, tmap=tmap)
        return obj.value