docs: def filter(self, cls, recursive=False):
          """Retrieves all descendants (including self) that are instances
              of a given class.
  
          Args:
              cls (class): The class to use as a filter.
  
          Kwargs:
              recursive (bool): Whether to descend recursively down the tree.
          """
          source = self.walk_preorder if recursive else self._children
          return [
              codeobj
              for codeobj in source()
              if isinstance(codeobj, cls)
          ]