code: def add_observer(self, observer):
          
          if not isinstance(observer, PowerManagementObserver):
              raise TypeError("observer MUST conform to power.PowerManagementObserver")
          self._weak_observers.append(weakref.ref(observer))
docs: Adds weak ref to an observer.
  
          @param observer: Instance of class registered with PowerManagementObserver
          @raise TypeError: If observer is not registered with PowerManagementObserver abstract class