Strip ids_to_strip from the end ids.
(ids, ids_to_strip)
| 26 | |
| 27 | |
| 28 | def strip_ids(ids, ids_to_strip): |
| 29 | """Strip ids_to_strip from the end ids.""" |
| 30 | ids = list(ids) |
| 31 | while ids and ids[-1] in ids_to_strip: |
| 32 | ids.pop() |
| 33 | return ids |
| 34 | |
| 35 | |
| 36 | class TextEncoder(object): |