(st, spaces)
| 1396 | } |
| 1397 | |
| 1398 | def indent(st, spaces): |
| 1399 | indentation = ' ' * spaces |
| 1400 | indented = indentation + st.replace('\n', '\n' + indentation) |
| 1401 | # trim off any trailing spaces |
| 1402 | indented = re.sub(r' +$', r'', indented) |
| 1403 | return indented |
| 1404 | |
| 1405 | |
| 1406 | # maps [nin, nout][type] to a suffix |