(text)
| 14 | |
| 15 | |
| 16 | def method(text): |
| 17 | start = text.index('void FileExpertSource::gate_capacity() {') |
| 18 | depth = 0 |
| 19 | for end in range(text.index('{', start), len(text)): |
| 20 | depth += (text[end] == '{') - (text[end] == '}') |
| 21 | if depth == 0: |
| 22 | return text[start:end + 1] |
| 23 | raise ValueError('Unclosed gate method') |
| 24 | |
| 25 | |
| 26 | SCAFFOLD = r''' |