Allow captured functions to be called normal code
This change enables non-experiment code to call captured functions.
When loading the configuration of a runned experiment this is
useful:
```
from my_experiment import load_model
config = load_config()   # load config
model = load_model(**config)  # creates model with saved config
```
@@ -41,11 +41,13 @@ def captured_function(wrapped, instance, args, kwargs):
bound = (instance is not None)
args, kwargs = wrapped.signature.construct_arguments(args, kwargs, options,
bound)
+ if wrapped.logger is not None:
wrapped.logger.debug("Started")
start_time = time.time()
# =================== run actual function =================================
result = wrapped(*args, **kwargs)
# =========================================================================
+ if wrapped.logger is not None:
stop_time = time.time()
elapsed_time = timedelta(seconds=round(stop_time - start_time))
wrapped.logger.debug("Finished after %s.", elapsed_time)
