(single_input_return)
| 212 | |
| 213 | |
| 214 | def single_input_kwargs(single_input_return): |
| 215 | try: |
| 216 | # 协程模式下,单项输入为协程对象,可以通过send(None)来获取传入单项输入的参数字典 |
| 217 | # In the coroutine mode, the item of `inputs` is coroutine object. |
| 218 | # using `send(None)` to get the single input function's parameter dict. |
| 219 | single_input_return.send(None) |
| 220 | except StopIteration as e: # This is in the coroutine mode |
| 221 | input_kwargs = e.args[0] |
| 222 | except AttributeError: # This is in the thread mode |
| 223 | input_kwargs = single_input_return |
| 224 | else: |
| 225 | raise RuntimeError("Can't get kwargs from single input") |
| 226 | return input_kwargs |
| 227 | |
| 228 | |
| 229 | @chose_impl |
no test coverage detected
searching dependent graphs…