Created
September 15, 2022 14:26
-
-
Save cemoody/0fb3601c0800320e4246f81eace91aa3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def switch_modal_function(stub=None, use_modal=True, **kwargs): | |
def wrapper(inner_func): | |
if use_modal: | |
assert stub is not None, "If using modal, please provide `stub`." | |
return stub.function(**kwargs)(inner_func) | |
else: | |
return inner_func | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment