(content: Any)
return set()
extract all variables in content recursively.
extract all variables in content recursively.
extract all variables in content recursively .
def extract_variables(content: Any) -> Set:
    """ extract all variables in content recursively.
    """
    if isinstance(content, (list, set, tuple)):
        variables = set()
        for item in content:
            variables = variables | extract_variables(item)
        return variables

    elif isinstance(content, dict):
        variables = set()
        for key, value in content.items():
            variables = variables | extract_variables(value)
        return variables

    elif isinstance(content, str):
        return set(regex_findall_variables(content))

    return set()
def extract_variables ( content : Any ) -> Set : if isinstance ( content , ( list , set , tuple ) ) : variables = set ( ) for item in content : variables = variables | extract_variables ( item ) return variables elif isinstance ( content , dict ) : variables = set ( ) for key , value in content . items ( ) : variables = variables | extract_variables ( value ) return variables elif isinstance ( content , str ) : return set ( regex_findall_variables ( content ) ) return set ( )