(self, entities)
| 497 | requirement["instructions"] = requirement["metadata"].get("@instructions") |
| 498 | |
| 499 | def limit_entities(self, entities): |
| 500 | if len(entities) > self.entity_limit: |
| 501 | if entities[0]["element_type"]: |
| 502 | return self.group_by_type(entities) |
| 503 | return entities[0 : self.entity_limit] |
| 504 | return entities |
| 505 | |
| 506 | def group_by_type(self, entities): |
| 507 | results = [] |