def _set_option(self, name, value, allow_clear=False):
        """Set value for an option."""
        if not allow_clear:
            # Prevent clears if value was set
            try:
                current_value = self._get_option(name)
                if value is None and current_value is not None:
                    return
            except AttributeError:
                pass

        self.opts[name] = value
def _set_option ( self , name , value , allow_clear = False ) : if not allow_clear : try : current_value = self . _get_option ( name ) if value is None and current_value is not None : return except AttributeError : pass self . opts [ name ] = value
Set value for an option.