def apply( self, obj, defaults = {}, **kwargs ):
      """: Apply this style to the given object using the supplied defaults.

      = NOTE
      - This applies to any matplotlib Figure object.

      = INPUT VARIABLES
      - obj       The object to apply the style to.
      - defaults  Keyword-value dictionary with defaults values to use if a
                  property value is not specified.
      - kwargs    Keyword-value dictionary whose values will supercede
                  any values set by the properties of this sub-style.
      """
      if not isinstance( obj, mplfig.Figure ):
         msg = "Unable to apply this sub-style to the given element." \
               "Expected a matplotlib 'Figure' and instead received " \
               "the following:\n%s" % (obj,)
         raise Exception( msg )

      # First update the defaults for all children components
      defaults = S.lib.resolveDefaults( defaults, bgColor = self.bgColor )

      # Background patch
      subKwargs = kwargs.get( 'frame', {} )
      subDefaults = S.lib.resolveDefaults( defaults, ['frame'] )

      bgColor = self.getValue( 'bgColor', defaults, **kwargs )
      if ( ('color' in subKwargs) and (subKwargs[ 'color' ] is None) ) or \
           (subKwargs not in 'color'):
         subKwargs[ 'color' ] = kwargs.get( 'bgColor', bgColor )

      self._patch.apply( obj.patch, subDefaults, **subKwargs )

      # Subplot spacing
      subDefaults = S.lib.resolveDefaults( defaults,
                                      leftMargin = obj.subplotpars.left,
                                      rightMargin = 1.0 - obj.subplotpars.right,
                                      topMargin = 1.0 - obj.subplotpars.top,
                                      bottomMargin = obj.subplotpars.bottom,
                                      axesPadX = obj.subplotpars.wspace,
                                      axesPadY = obj.subplotpars.hspace )
      l = self.getValue( 'leftMargin', subDefaults, **kwargs )
      r = self.getValue( 'rightMargin', subDefaults, **kwargs )
      t = self.getValue( 'topMargin', subDefaults, **kwargs )
      b = self.getValue( 'bottomMargin', subDefaults, **kwargs )
      x = self.getValue( 'axesPadX', subDefaults, **kwargs )
      y = self.getValue( 'axesPadY', subDefaults, **kwargs )

      obj.subplots_adjust( left = l, right = 1.0 - r,
                           top = 1.0 - t, bottom = b,
                           wspace = x, hspace = y )


      # Width
      width = self.getValue( 'width', defaults, **kwargs )
      if width is None:
         width = obj.get_figwidth()

      # Height
      height = self.getValue( 'height', defaults, **kwargs )
      if height is None:
         height = obj.get_figheight()

      # Make sure to physically resize the canvas containing the figure
      obj.set_size_inches( width, height, forward = True )

      # DPI
      value = self.getValue( 'dpi', defaults, **kwargs )
      if value is not None:
         obj.set_dpi( value )

   #-----------------------------------------------------------------------
dataset/ETHPy150Open nasa/mplStyle/mplStyle/MplFigureStyle.py/MplFigureStyle.apply/swapped operands of `not in`