code: def prune(self, depth=0):
          
          for n in list(self.nodes):
              if len(n.links) <= depth:
                  self.remove_node(n.id)
docs: Removes all nodes with less or equal links than depth.