code: def _ValidateValue(value, type_check):
    
    if inspect.isclass(type_check):
      return isinstance(value, type_check)
    if isinstance(type_check, tuple):
      return _ValidateTuple(value, type_check)
    elif callable(type_check):
      return type_check(value)
    else:
      raise TypeError("Invalid type check '%s'" % repr(type_check))
docs: Validate a single value with type_check.