(self, input, method_name="superconductors", params={}, headers={"Accept": "application/json"})
| 293 | return status, json.loads(res.text) |
| 294 | |
| 295 | def process_text(self, input, method_name="superconductors", params={}, headers={"Accept": "application/json"}): |
| 296 | |
| 297 | files = {"text": input} |
| 298 | |
| 299 | the_url = self.get_url(method_name) |
| 300 | params, the_url = self.get_params_from_url(the_url) |
| 301 | |
| 302 | res, status = self.post(url=the_url, files=files, data=params, headers=headers) |
| 303 | |
| 304 | if status == 503: |
| 305 | time.sleep(self.config["sleep_time"]) |
| 306 | return self.process_text(input, method_name, params, headers) |
| 307 | elif status != 200: |
| 308 | print("Processing failed with error " + str(status)) |
| 309 | return status, None |
| 310 | else: |
| 311 | return status, json.loads(res.text) |
| 312 | |
| 313 | def process_pdf(self, form_data: dict, method_name="superconductors", params={}, headers={"Accept": "application/json"}): |
| 314 |
no test coverage detected