duo_ai.utils.global_variables ============================= .. py:module:: duo_ai.utils.global_variables Attributes ---------- .. autoapisummary:: duo_ai.utils.global_variables.GLOBAL_VARIABLES Functions --------- .. autoapisummary:: duo_ai.utils.global_variables.set_global_variable duo_ai.utils.global_variables.get_global_variable duo_ai.utils.global_variables.get_all_global_variables Module Contents --------------- .. py:data:: GLOBAL_VARIABLES .. py:function:: set_global_variable(key, value) Set a global variable by key. :param key: The key for the global variable. :type key: str :param value: The value to set for the global variable. :type value: Any :rtype: None .. rubric:: Examples >>> set_global_variable('device', 'cuda') .. py:function:: get_global_variable(key) Retrieve the value of a global variable by key. :param key: The key for the global variable. :type key: str :returns: The value of the global variable, or None if not set. :rtype: Any or None .. rubric:: Examples >>> get_global_variable('device') 'cuda' .. py:function:: get_all_global_variables() Get the dictionary of all global variables. :returns: Dictionary of all global variables. :rtype: dict .. rubric:: Examples >>> get_all_global_variables() {'device': 'cuda', 'seed': 42}