From anonymous, 3 Weeks ago, written in Python.
Embed
  1. def redact(root):
  2.     objs = [root]
  3.     while objs:
  4.         o = objs.pop()
  5.         if isinstance(o, dict):
  6.             o.pop("password")
  7.             objs += o.values()
  8.         elif isinstance(o, list):
  9.             objs += o