(s, max_length=400)
| 142 | |
| 143 | @staticmethod |
| 144 | def truncate(s, max_length=400): |
| 145 | half = max_length // 2 |
| 146 | if len(s) > max_length: |
| 147 | s = s[:half] + "..." + s[-half:] |
| 148 | return s |
| 149 | |
| 150 | def batch_apply(self, batch_code): |
| 151 | all_code_snippets = self.process_generation_to_code(batch_code) |