from threading import Thread


def run_threaded(non_blocking, target_func, *args, **kwargs):
    """Call a function in a thread, when specified"""
    if not non_blocking:
        return target_func(*args, **kwargs)
    Thread(target=target_func, args=args, kwargs=kwargs).start()
    return None