original_docstring:  Apply a set of theme values which will be used rather than
          defaults, but will not override application-set values.
  
          The passed-in dictionary may be kept around as-is and shared with
          other instances to save memory (so neither the caller nor the
          |HasProps| instance should modify it).
  
          Args:
              property_values (dict) : theme values to use in place of defaults
  
          Returns:
              None
  
          
docstring: Apply a set of theme values which will be used rather than
  defaults, but will not override application-set values.
  
  The passed-in dictionary may be kept around as-is and shared with
  other instances to save memory (so neither the caller nor the
  |HasProps| instance should modify it).
docstring_tokens: Apply a set of theme values which will be used rather than defaults but will not override application - set values . The passed - in dictionary may be kept around as - is and shared with other instances to save memory ( so neither the caller nor the |HasProps| instance should modify it ) .
code: def apply_theme(self, property_values):
          ''' Apply a set of theme values which will be used rather than
          defaults, but will not override application-set values.
  
          The passed-in dictionary may be kept around as-is and shared with
          other instances to save memory (so neither the caller nor the
          |HasProps| instance should modify it).
  
          Args:
              property_values (dict) : theme values to use in place of defaults
  
          Returns:
              None
  
          '''
          old_dict = self.themed_values()
  
          # if the same theme is set again, it should reuse the same dict
          if old_dict is property_values:
              return
  
          removed = set()
          # we're doing a little song-and-dance to avoid storing __themed_values__ or
          # an empty dict, if there's no theme that applies to this HasProps instance.
          if old_dict is not None:
              removed.update(set(old_dict.keys()))
          added = set(property_values.keys())
          old_values = dict()
          for k in added.union(removed):
              old_values[k] = getattr(self, k)
  
          if len(property_values) > 0:
              setattr(self, '__themed_values__', property_values)
          elif hasattr(self, '__themed_values__'):
              delattr(self, '__themed_values__')
  
          # Property container values might be cached even if unmodified. Invalidate
          # any cached values that are not modified at this point.
          for k, v in old_values.items():
              if k in self._unstable_themed_values:
                  del self._unstable_themed_values[k]
  
          # Emit any change notifications that result
          for k, v in old_values.items():
              descriptor = self.lookup(k)
              descriptor.trigger_if_changed(self, v)
code_tokens: def apply_theme ( self , property_values ) : old_dict = self . themed_values ( ) if old_dict is property_values : return removed = set ( ) if old_dict is not None : removed . update ( set ( old_dict . keys ( ) ) ) added = set ( property_values . keys ( ) ) old_values = dict ( ) for k in added . union ( removed ) : old_values [ k ] = getattr ( self , k ) if len ( property_values ) > 0 : setattr ( self , '__themed_values__' , property_values ) elif hasattr ( self , '__themed_values__' ) : delattr ( self , '__themed_values__' ) for k , v in old_values . items ( ) : if k in self . _unstable_themed_values : del self . _unstable_themed_values [ k ] for k , v in old_values . items ( ) : descriptor = self . lookup ( k ) descriptor . trigger_if_changed ( self , v )
short_docstring: Apply a set of theme values which will be used rather than
  defaults, but will not override application-set values.
short_docstring_tokens: Apply a set of theme values which will be used rather than defaults but will not override application - set values .
comment: ''' Apply a set of theme values which will be used rather than
          defaults, but will not override application-set values.
  
          The passed-in dictionary may be kept around as-is and shared with
          other instances to save memory (so neither the caller nor the
          |HasProps| instance should modify it).
  
          Args:
              property_values (dict) : theme values to use in place of defaults
  
          Returns:
              None
  
          '''$SEP$# if the same theme is set again, it should reuse the same dict$SEP$# we're doing a little song-and-dance to avoid storing __themed_values__ or$SEP$# an empty dict, if there's no theme that applies to this HasProps instance.$SEP$# Property container values might be cached even if unmodified. Invalidate$SEP$# any cached values that are not modified at this point.$SEP$# Emit any change notifications that result