def get_deep(dictionary: dict, keys: list[str], default=None):
    """Gets a value from a nested dictionary without erroring if the key doesn't exist."""
    try:
        for key in keys:
            dictionary = dictionary[key]
        return dictionary
    except KeyError:
        return default
Gets a value from a nested dictionary without erroring if the key doesn't exist.
gradio/cli/commands/components/_docs_utils.py