code: def _setattr_default(obj, attr, value, default):
      
      if value is None:
          setattr(obj, attr, default)
      else:
          setattr(obj, attr, value)
docs: Set an attribute of an object to a value or default value.