code: def assert_valid(self, instance, value=None):
          
          valid = super(Union, self).assert_valid(instance, value)
          if not valid:
              return False
          if value is None:
              value = instance._get(self.name)
              if value is None:
                  return True
          return self._try_prop_method(instance, value, 'assert_valid')
docs: Check if the Union has a valid value