code: def merge_upwards_if_smaller_than(self, small_size, a_or_u):
          
  
          # Assert that we're not messing things up.
          prev_app_size = self.app_size()
          prev_use_size = self.use_size()
  
          small_nodes = self._find_small_nodes(small_size, (), a_or_u)
          for node, parents in small_nodes:
              # Check immediate grandparent for isdir=None and if it
              # exists, move this there. The isdir=None node is always
              # last.
              if len(parents) >= 2:
                  tail = parents[-2]._nodes[-1]
                  if tail._isdir is None:
                      assert tail._app_size is not None, tail
                      tail._add_size(node.app_size(), node.use_size())
                      parents[-1]._nodes.remove(node)
                      assert len(parents[-1]._nodes)
  
          # The actual assertion.
          assert prev_app_size == self.app_size(), (
              prev_app_size, self.app_size())
          assert prev_use_size == self.use_size(), (
              prev_use_size, self.use_size())
docs: After prune_if_smaller_than is run, we may still have excess
          nodes.
  
          For example, with a small_size of 609710690:
  
                       7  /*
                28815419  /data/*
                      32  /data/srv/*
                  925746  /data/srv/docker.bak/*
                      12  /data/srv/docker.bak/shared/*
               682860348  /data/srv/docker.bak/shared/standalone/*
  
          This is reduced to:
  
                31147487  /*
               682860355  /data/srv/docker.bak/shared/standalone/*
  
          Run this only when done with the scanning.