(self, input, method_name="superconductors", params={}, headers={"Accept": "application/json"})
| 275 | return action_url |
| 276 | |
| 277 | def process_texts(self, input, method_name="superconductors", params={}, headers={"Accept": "application/json"}): |
| 278 | |
| 279 | files = {"texts": input} |
| 280 | |
| 281 | the_url = self.get_url(method_name) |
| 282 | params, the_url = self.get_params_from_url(the_url) |
| 283 | |
| 284 | res, status = self.post(url=the_url, files=files, data=params, headers=headers) |
| 285 | |
| 286 | if status == 503: |
| 287 | time.sleep(self.config["sleep_time"]) |
| 288 | return self.process_texts(input, method_name, params, headers) |
| 289 | elif status != 200: |
| 290 | print("Processing failed with error " + str(status)) |
| 291 | return status, None |
| 292 | else: |
| 293 | return status, json.loads(res.text) |
| 294 | |
| 295 | def process_text(self, input, method_name="superconductors", params={}, headers={"Accept": "application/json"}): |
| 296 |
no test coverage detected