Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_default_values_of():
def f(a, b=2, c=None, *args, **kwargs):
pass
defaults = utils.default_values_of(f)
assert defaults == ["b", "c", "args", "kwargs"]
async def unsafe_ask_async(self, patch_stdout: bool = False) -> Any:
"""Ask the question using asyncio and return user response.
Does not catch keyboard interrupts."""
if not utils.ACTIVATED_ASYNC_MODE:
await utils.activate_prompt_toolkit_async_mode()
if patch_stdout:
# with prompt_toolkit.patch_stdout.patch_stdout():
return await self.application.run_async().to_asyncio_future()
else:
return await self.application.run_async().to_asyncio_future()
async def unsafe_ask_async(self, patch_stdout: bool = False) -> Any:
"""Ask the question using asyncio and return user response.
Does not catch keyboard interrupts."""
if not utils.ACTIVATED_ASYNC_MODE:
await utils.activate_prompt_toolkit_async_mode()
if patch_stdout:
# with prompt_toolkit.patch_stdout.patch_stdout():
return await self.application.run_async().to_asyncio_future()
else:
return await self.application.run_async().to_asyncio_future()