code: def _check_or_enforce_type(self, value):
          
          if self._enable_enforce_type:
              return self.enforce_type(value)
  
          try:
              new_value = self.enforce_type(value)
          except:  # pylint: disable=bare-except
              message = "The value {!r} could not be enforced ({})".format(
                  value, traceback.format_exc().splitlines()[-1])
              warnings.warn(message, FailingEnforceTypeWarning, stacklevel=3)
          else:
              try:
                  equal = value == new_value
              except TypeError:
                  equal = False
              if not equal:
                  message = "The value {!r} would be enforced to {!r}".format(
                      value, new_value)
                  warnings.warn(message, ModifyingEnforceTypeWarning, stacklevel=3)
  
          return value
docs: Depending on whether enforce_type is enabled call self.enforce_type and
          return the result or call it and trigger a silent warning if the result
          is different or a Traceback
  
          To aid with migration, enable the warnings with:
              warnings.simplefilter("always", FailingEnforceTypeWarning)
              warnings.simplefilter("always", ModifyingEnforceTypeWarning)