code: def clear_descendants(self, source, clear_source=True):
          
          desc = nx.descendants(self, source)
          if clear_source:
              desc.add(source)
          self.remove_nodes_from(desc)
          return desc
docs: Remove all descendants of(reachable from) `source`.
  
          Args:
              source: Node descendants
              clear_source(bool): Remove origin too if True.
          Returns:
              set: The removed nodes.