code: def visit_class(rec, cls, op):
      # type: (Any, Iterable, Union[Callable[..., Any], partial[Any]]) -> None
      
  
      if isinstance(rec, MutableMapping):
          if "class" in rec and rec.get("class") in cls:
              op(rec)
          for d in rec:
              visit_class(rec[d], cls, op)
      if isinstance(rec, MutableSequence):
          for d in rec:
              visit_class(d, cls, op)
docs: Apply a function to with "class" in cls.