(self, cfg: Optional[Dict] = None)
| 108 | } |
| 109 | |
| 110 | def __init__(self, cfg: Optional[Dict] = None): |
| 111 | _check_deps_for_python_executor() |
| 112 | import multiprocess |
| 113 | from multiprocess import Pool |
| 114 | super().__init__(cfg) |
| 115 | |
| 116 | runtime: Optional[Any] = self.cfg.get('runtime', None) |
| 117 | get_answer_symbol: Optional[str] = self.cfg.get('get_answer_symbol', None) |
| 118 | get_answer_expr: Optional[str] = self.cfg.get('get_answer_expr', None) |
| 119 | get_answer_from_stdout: bool = self.cfg.get('get_answer_from_stdout', True) |
| 120 | timeout_length: int = self.cfg.get('timeout_length', 20) |
| 121 | |
| 122 | self.runtime = runtime if runtime else GenericRuntime() |
| 123 | self.answer_symbol = get_answer_symbol |
| 124 | self.answer_expr = get_answer_expr |
| 125 | self.get_answer_from_stdout = get_answer_from_stdout |
| 126 | self.pool = Pool(multiprocess.cpu_count()) |
| 127 | self.timeout_length = timeout_length |
| 128 | |
| 129 | def call(self, params: Union[str, dict], **kwargs) -> list: |
| 130 | try: |
nothing calls this directly
no test coverage detected