config_utils
call_once(func, on_second_call='noop')
Decorator to ensure that a function is only called once.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_second_call
|
str
|
what happens when the function is called a second time. |
'noop'
|
Source code in OmniGibson/omnigibson/learning/utils/config_utils.py
meta_decorator(decor)
a decorator decorator, allowing the wrapped decorator to be used as: @decorator(args, *kwargs) def callable() -- or -- @decorator # without parenthesis, args and kwargs will use default def callable()
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decor
|
a decorator whose first argument is a callable (function or class to be decorated), and the rest of the arguments can be omitted as default. decor(f, ... the other arguments must have default values) |
required |
Warning
decor can NOT be a function that receives a single, callable argument. See stackoverflow: http://goo.gl/UEYbDB