docs: def Trim(self, flags):
          """
          Trim the nodes from the tree keeping only the root hash.
  
          Args:
              flags: "0000" for trimming, any other value for keeping the nodes.
          """
          logger.info("Trimming!")
          flags = bytearray(flags)
          length = 1 << self.Depth - 1
          while len(flags) < length:
              flags.append(0)
  
          MerkleTree._TrimNode(self.Root, 0, self.Depth, flags)