code: def __configure_annotations(mapper, cls):
      
      annotations = {}
      annotations_by_attr = {}
  
      # An attribute may be defined more than once in base classes. Only handle the first
      processed = set()
  
      # Loop through all attributes in the class and its base classes, looking for annotations
      for base in cls.__mro__:
          for name, attr in base.__dict__.items():
              if name in processed or name.startswith('__'):
                  continue
  
              # 'data' is a list of string annotations
              if isinstance(attr, collections.Hashable) and attr in __cache__:
                  data = __cache__[attr]
                  del __cache__[attr]
              elif isinstance(attr, InstrumentedAttribute) and attr.property in __cache__:
                  data = __cache__[attr.property]
                  del __cache__[attr.property]
              elif hasattr(attr, '_coaster_annotations'):
                  data = attr._coaster_annotations
              else:
                  data = None
              if data is not None:
                  annotations_by_attr.setdefault(name, []).extend(data)
                  for a in data:
                      annotations.setdefault(a, []).append(name)
                  processed.add(name)
  
      # Classes specifying ``__annotations__`` directly isn't supported,
      # so we don't bother preserving existing content, if any.
      if annotations:
          cls.__annotations__ = annotations
      if annotations_by_attr:
          cls.__annotations_by_attr__ = annotations_by_attr
      annotations_configured.send(cls)
docs: Run through attributes of the class looking for annotations from
      :func:`annotation_wrapper` and add them to :attr:`cls.__annotations__`
      and :attr:`cls.__annotations_by_attr__`