code: def _validate_method_decoration(meta, class_):
          super_mro = class_.__mro__[1:]
          own_methods = ((name, member)
                         for name, member in class_.__dict__.items()
                         if is_method(member))
          for name, method in own_methods:
              shadowed_method, base_class = next(
                  ((getattr(base, name), base)
                   for base in super_mro if hasattr(base, name)),
                  (None, None)
              )
              if meta._is_override(method):
                  if not shadowed_method:
                      raise ClassError("unnecessary @override on %s.%s" % (
                          class_.__name__, name), class_=class_)
                  if meta._is_final(shadowed_method):
                      raise ClassError(
                          "illegal @override on a @final method %s.%s" % (
                              base_class.__name__, name), class_=class_)
                  override_base = meta._get_override_base(method)
                  if override_base and base_class is not override_base:
                      if is_class(override_base):
                          raise ClassError(
                              "incorrect override base: expected %s, got %s" % (
                                  base_class.__name__, override_base.__name__))
                      else:
                          raise ClassError(
                              "invalid override base specified: %s" % (
                                  override_base,))
                  setattr(class_, name, method.method)
              else:
                  if shadowed_method and name not in meta.OVERRIDE_EXEMPTIONS:
                      if meta._is_final(shadowed_method):
                          msg = "%s.%s is hiding a @final method %s.%s" % (
                              class_.__name__, name, base_class.__name__, name)
                      else:
                          msg = ("overridden method %s.%s "
                                 "must be marked with @override" % (
                                  class_.__name__, name))
                      raise ClassError(msg, class_=class_)