coding
coding.func_with_reqs
with_requirements
Decorate a function with package and import requirements
Arguments:
python_packages
List[str], optional - Packages required to function. Can include version info.. Defaults to [].global_imports
List[Import], optional - Required imports. Defaults to [].
Returns:
Callable[[Callable[P, T]], FunctionWithRequirements[T, P]]: The decorated function
to_stub
Generate a stub for a function as a string
Arguments:
func
Callable[…, Any] - The function to generate a stub for
Returns:
str
- The stub for the function