code: def _get_annotations(cls):
      
      anns = getattr(cls, "__annotations__", None)
      if anns is None:
          return {}
  
      # Verify that the annotations aren't merely inherited.
      for base_cls in cls.__mro__[1:]:
          if anns is getattr(base_cls, "__annotations__", None):
              return {}
  
      return anns
docs: Get annotations for *cls*.