added doc strings to execute_with_multiprocessing_lock
@@ -33,6 +33,14 @@ MULTIPROCESSING_LOCK = multiprocessing.Manager().Lock()
def execute_with_multiprocessing_lock(execution_function, *args, **kwargs):
+ """ A helper utility function that executes a given function with multiprocessing lock if the process is being
+ executed in a multi-processing mode
+
+ :param execution_function: A function
+ :param args: Function's positional arguments
+ :param kwargs: Function's keyword arguments
+ :return: Function's results
+ """
if multiprocessing.current_process().name == 'MainProcess':
return execution_function(*args, **kwargs)
