code: def _renamer(self, tre):
          
          ## get the tre with numbered tree tip labels
          names = tre.get_leaves()
  
          ## replace numbered names with snames
          for name in names:
              name.name = self.samples[int(name.name)]
  
          ## return with only topology and leaf labels
          return tre.write(format=9)
docs: renames newick from numbers to sample names