code: def add_traits(self, **traits):
          
          super(Widget, self).add_traits(**traits)
          for name, trait in traits.items():
              if trait.get_metadata('sync'):
                  self.keys.append(name)
                  self.send_state(name)
docs: Dynamically add trait attributes to the Widget.