docstr: Calculate missing attribute
docstr_tok: ["Calculate","missing","attribute"]
code: def __getattr__(self, id):
      """Calculate missing attribute"""
      if id[:4] == "_get":
          raise AttributeError(id)
      # calculate missing attribute
      v = getattr(self, "_get" + id)()
      setattr(self, id, v)
      return v
  
file_path: pillow/src/PIL/ImageStat.py
imports: from __future__ import annotations
  import math
label_desc: Use image node_id 2 for calling the Stat obj's underlying member method code with example usage: obj.__getattr__(id) and returns: v