def is_complex(value: Any) -> bool:
    'Test if data structure is a complex template.'
    if isinstance(value, Template):
        return True
    if isinstance(value, list):
        return any((is_complex(val) for val in value))
    if isinstance(value, collections.abc.Mapping):
        return (any((is_complex(val) for val in value.keys())) or any((is_complex(val) for val in value.values())))
    return False
Test if data structure is a complex template.
def is_complex(value: Any) -> bool:
    
    if isinstance(value, Template):
        return True
    if isinstance(value, list):
        return any((is_complex(val) for val in value))
    if isinstance(value, collections.abc.Mapping):
        return (any((is_complex(val) for val in value.keys())) or any((is_complex(val) for val in value.values())))
    return False