class_docstr: This `Scratchpad` validates attribute values.
class_docstr_tok: ["This","`","Scratchpad","`","validates","attribute","values","."]
code: def __setattr__(self, attr, obj):
      if getattr(self, "attr", None) == attr:
          obj = self.attr_filter(obj)
  
      return object.__setattr__(self, attr, obj)
  
imports: import linecache
  import sys
  import traceback
  from abc import ABCMeta
  from collections.abc import Sequence
  from io import StringIO
  from typing import TYPE_CHECKING, Any, Optional, TypeVar, Union
label_desc: Use image node_id 2 for calling the ValidatingScratchpad obj's underlying member method code with example usage: obj.__setattr__(attr, obj) and returns: object